﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterAdmin.master" AutoEventWireup="true" CodeBehind="HomeAdmin.aspx.cs" Inherits="Project_Udrinkwater.PagesAdmin.HomeAdmin" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
       <script runat="server">
    protected void Page_Init(object sender, EventArgs e) {
        DateLabel.Text = new DateTime(DateTime.Now.Year,DateTime.Now.Month,DateTime.Now.Day).ToLongDateString();
    }
</script>
<script type="text/javascript">
// <![CDATA[
    function PrepareTimeValue(value) {
        if (value < 10)
            value = "0" + value;
        return value;
    }
    function UpdateTime(s, e) {
        var dateTime = new Date();
        var timeString = PrepareTimeValue(dateTime.getHours()) + ":" + PrepareTimeValue(dateTime.getMinutes()) + ":" +
            PrepareTimeValue(dateTime.getSeconds());
        timeLabel.SetText(timeString);


    }
// ]]> 
</script>

<div style="margin-top: 50px">
      <dx:ASPxTimer runat="server" Interval="1000" ClientInstanceName="timer" 
    ID="Timer">
<ClientSideEvents Tick="UpdateTime" Init="UpdateTime"></ClientSideEvents>
</dx:ASPxTimer>

      <table align="center">
          <tr>
              <td colspan="2">

                  <dx:ASPxLabel ID="ASPxLabel2" runat="server" Font-Size="Medium" 
                      Text="ยินดีต้อนรับ">
                  </dx:ASPxLabel>
&nbsp;:
                  <dx:ASPxLabel ID="lb_Adminlogin" runat="server" Font-Size="Medium" 
                      Text="[Admin]">
                  </dx:ASPxLabel>
&nbsp;
                  <dx:ASPxLabel ID="ASPxLabel3" runat="server" Font-Size="Medium" 
                      Text="เข้าสู่ระบบ">
                  </dx:ASPxLabel>

              </td>
          </tr>
          <tr>
              <td>

    <dx:ASPxLabel runat="server" ClientInstanceName="dateLabel" 
    Font-Size="18px" ID="DateLabel"></dx:ASPxLabel>

              </td>
              <td>

    <dx:ASPxLabel runat="server" ClientInstanceName="timeLabel" 
    Font-Size="18px" Font-Bold="True" ID="TimeLabel"></dx:ASPxLabel>

              </td>
          </tr>
          <tr>
              <td>
                  &nbsp;</td>
              <td>
                  &nbsp;</td>
          </tr>
      </table>

</div>
        
      

</asp:Content>
